package com.itheima.wenjian;

import java.io.File;

/**
 * @author zhangbaiyan
 * @date 2024-09-19 17:34
 * @description:
 * @version:
 */
public class test3 {
    public static void main(String[] args) {

        File f = new File("C:\\Users\\17685\\Desktop\\rouyi-906\\src");
        deleteFile(f);
    }
    public static void deleteFile(File file){
        File[] f = file.listFiles();
        for (File f1 : f) {
            if (file.isFile()){
                if (f1.getName().endsWith(".avi"))  file.delete();
            }else {
                deleteFile(f1);
            }
        }
//        file.delete();

    }
}
